package com.rockxin.cat.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.rockxin.cat.R;
import com.rockxin.cat.bean.UseBean;

import java.util.List;

/**
 * Created by cat on 18-3-2.
 * 标的列表
 */

public class TargetListAdapter extends BaseQuickAdapter<UseBean, BaseViewHolder> {

    public TargetListAdapter(int layoutResId, @Nullable List<UseBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder viewHolder, UseBean item) {
        viewHolder.setText(R.id.tv_title, item.getName())
                .setText(R.id.tv_rate, item.getRate_foramt())
                .setText(R.id.tv_term, item.getRepay_time())
                .setText(R.id.tv_money, item.getBorrow_amount());

        Glide.with(mContext).load("http://pic2.sc.chinaz.com/files/pic/pic9/201802/zzpic10614.jpg").into((ImageView) viewHolder.getView(R.id.iv_bg));
    }
}
